<template>
  <div class="common-layout">
    <el-container>
      <el-aside width="200px">
        <el-menu
          active-text-color="#ffd04b"
          background-color="#545c64"
          class="left-menu"
          :default-active="routePath"
          text-color="#fff"
          :router="true"
        >
          <!-- 只有一级目录 -->
          <el-menu-item index="/home">
            <el-icon>
              <document />
            </el-icon>
            <span>首页</span>
          </el-menu-item>
          <!-- 有一级和二级目录 -->

          <el-sub-menu index="/pro-man">
            <!-- 插槽--控制一级目录的标题 -->
            <template #title>
              <el-icon>
                <location />
              </el-icon>
              <span>商品管理</span>
            </template>
            <!--二级菜单  -->

            <el-menu-item index="/prolist">
              <el-icon> <document /> </el-icon>商品列表
            </el-menu-item>
            <el-menu-item index="/category"
              ><el-icon> <document /> </el-icon>商品分类</el-menu-item
            >
          </el-sub-menu>
          <el-sub-menu index="/pro-man1">
            <!-- 插槽--控制一级目录的标题 -->
            <template #title>
              <el-icon>
                <location />
              </el-icon>
              <span>轮播图管理</span>
            </template>
            <!--二级菜单  -->

            <el-menu-item index="/swiperlist">
              <el-icon> <document /> </el-icon>轮播图列表
            </el-menu-item>
            <el-menu-item index="/swiperadd"
              ><el-icon> <document /> </el-icon>轮播图添加</el-menu-item
            >
          </el-sub-menu>

          <el-menu-item index="/usermanage">
            <el-icon>
              <document />
            </el-icon>
            <span>用户管理</span>
          </el-menu-item>
        </el-menu>
      </el-aside>

      <el-container class="right-content">
        <el-header class="header"> 头部 </el-header>

        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script setup>
import { useRoute } from "vue-router";
let route = useRoute()
let routePath = route.path


</script>

<style scoped>
.left-menu {
  height: 100vh;
}
.header {
  height: 5vh;
}
.right-content {
  height: 100vh;
}
</style>
